<?php echo $this->Html->css('difference/difference_games/index')?>

<div class="difference_games_index">
	<h1>
		<?php echo $this->element('google/plus_medium')?>
		Game tìm điểm khác nhau giữa các hình 
		<?php echo $this->Html->link('Chơi ngẫu nhiên', array('plugin' => 'difference', 'controller' => 'difference_games', 'action' => 'randgame'), array('class' => 'randomPlay', 'title' => 'Chơi ngẫu nhiên giúp bạn lựa chọn được hình và tự động bỏ qua các hình bạn đã chơi.'))?>
	</h1>
	<table border="0">
		<?php $i = 0?>
		<?php $item_per_row = 4?>
		<?php foreach($data as $post) : ?>
			<?php if($i % 4 == 0) : ?>
				<tr>
			<?php endif;?>
				<td align="left" valign="top">
					<div class="item-wrapper">
						<div class="item-body">
							<?php echo $this->Html->image(Configure::read('Web.differenceThumbImagesUrl') . $post['DifferenceGame']['picture1'], array('width' => '200'))?>
							<div class="playmask"></div>
							<?php echo $this->Html->link(null, array('plugin' => 'difference', 'controller' => 'difference_games', 'action' => 'view', $post['DifferenceGame']['seo_name'] ), array('class' => 'playlink'))?>
							<?php if(!empty($player) && !empty($post['DifferenceScore']['resolved'])): ?>
								<div class="played">
								<?php $sec = strtotime($post['DifferenceScore']['resolved']) - strtotime($post['DifferenceScore']['created']);?>
								bạn đã chơi hết <span><?php echo $sec?></span> giây
								</div>
							<?php endif;?>
						</div>
						
						<div class="item-head">
							<?php echo $html->link($post['DifferenceGame']['name'], array('plugin' => 'difference', 'controller' => 'difference_games', 'action' => 'view', $post['DifferenceGame']['seo_name'] ))?>
						</div>
					</div>
				</td>
			<?php if($i % 4 == 3) : ?>
				</tr>
			<?php endif;?>
		<?php $i++ ?>
		<?php endforeach;?>
	</table>
	<div class="pager">
		    
		    <?php
				// prev link
		    	echo $paginator->prev('« Trang trước ', null, null, array('class' => 'disabled'));
		    ?>
		    
		    <?php echo $paginator->numbers(); ?>
		    
		    <?php
				// next link
				echo $paginator->next(' Trang sau »', null, null, array('class' => 'disabled'));
		   		//echo $paginator->counter();
		    ?>
	</div>
</div>